﻿Imports VendasDAL
Imports EstoqueBLL
Public Class ItensVendaBLL
    Dim objDAL As ItensVendaDAL

#Region "Propriedades"
    Property IteCodigo As Integer
    Property ObjServico As ServicoBLL
#End Region

#Region "Métodos de serviços"

#Region "Excluir"
    Public Function ExcluirServicos() As Boolean
        Dim retorno As Boolean
        Try
            objDAL = New ItensVendaDAL
            objDAL.ExcluirServicos(Me.IteCodigo)
            retorno = True
        Catch ex As Exception
            retorno = False
            Throw ex
        Finally
            objDAL = Nothing
        End Try
        Return retorno
    End Function
#End Region

#Region "Localizar"
    Public Function LocalizarServicos() As DataTable
        Dim tab As DataTable
        Try
            objDAL = New ItensVendaDAL
            tab = objDAL.LocalizarServicos(Me.IteCodigo)
        Catch ex As Exception
            Throw ex
        Finally
            objDAL = Nothing
        End Try
        Return tab
    End Function
#End Region

#Region "Inserir"
    Public Function InserirServicos() As Boolean
        Dim ret As Boolean
        Try
            objDAL = New ItensVendaDAL
            objDAL.InserirServicos(Me.IteCodigo, Me.ObjServico.pro_codigo)
            ret = True
        Catch ex As Exception
            ret = False
            Throw ex
        Finally
            objDAL = Nothing
        End Try
        Return ret
    End Function
#End Region
#End Region

End Class
